<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>判断字符串个数</title>
</head>
<body>
<script>
    let arr = ["America","Grecec","Britain","Canada","Chinna","Egypt"];
    let count = 0;
    for(let index = 0;index < arr.length;index ++){
        if(arr[index].indexOf('a') != -1 || arr[index].indexOf('A') != -1){
            count++;
        }
        // for(let j  of arr[index]){
        //     if(j === 'a' || j === 'A'){
        //         count++;
        //     }
        // }
    }
    console.log("包含A或a的个数:"+count);
</script>
</body>
</html>